package com.neu;

import java.util.Random;

public class shuzu {
    public static void main(String[] args) {
        int num[]={12,34,56};
        /*for (int i = 0; i < num.length ; i++) {
            System.out.println(num[i]);
        }*/
        int max=num[0];
        for (int j = 0; j <num.length ; j++) {
            if (max<num[j]){
                max=num[j];
            }

        }
        System.out.println(max);
        int min=num[0];
        int sum = 0;
        for (int i = 0; i < num.length ; i++) {
            sum+=num[i];
            if (min>num[i]){
                min=num[i];
            }
        }
        System.out.println(min+"\n"+sum);

//        Random ran = new Random();
        int m[] = new int[10];
        for (int i = 0; i < 10; i++) {
            int x = (int)(Math.random()*100+1);
            m[i] = x;

        }
        System.out.println("排序前");
        for (int j=0;j<m.length;j++){
            System.out.print(m[j]+"\t");
        }
        for (int i = 1; i < m.length ; i++) {
            for (int j=0;j< m.length-i;j++){
                if (m[j]<m[j+1]){
                   int t=m[j];
                    m[j]=m[j+1];
                    m[j+1]=t;
                }
            }
        }
        System.out.println("排序后");
        for (int j=0;j<m.length;j++){
            System.out.print(m[j]+"\t");
        }
    }
}
